<%@ Page Language="VB" AutoEventWireup="false" CodeFile="StatusHistory.aspx.vb" EnableEventValidation="true" Inherits="Case_StatusHistory" %>
<%@ Register Assembly="InputControls" Namespace="InputControls" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Participant Status History</title>
    <script language="javascript">
    
    function addOption(selectbox,text,value )
    {
      var optn = document.createElement("OPTION");
      optn.text = text;
      optn.value = value;
      selectbox.options.add(optn);
    }
    
    function resetStatusList(statusddl, reasonddl)
    {
    var objStatusDDL=document.getElementById(statusddl);
    var objReasonDDL=document.getElementById(reasonddl);
    var selectedStatus=objStatusDDL.options[objStatusDDL.selectedIndex].value; 
    
    objReasonDDL.length=0;
       addAllOptions(objReasonDDL,selectedStatus);
    
    }
    </script>
     <style type="text/css">
     

        
           .labelNoAlign {
            font-family: ms sans serif,arial,verdana,helvetica,sans-serif;
            font-size: .85em;
            margin: .9em .5em 0em 0em;
            display: block;
            float: left;
            /* border: solid 1px green; */
        }
        
        
          H1 { font-family:MS Sans Serif, Arial, Verdana, Sans-Serif; 
	     font-size: 1em; 
             font-weight:bold; 
             color:#21334B
           }
           
        .gridOffset {
            margin-left: 10px;
            margin-top: 10px;
        }
              
        .headerStyle {
            font-family: ms sans serif,arial,verdana,helvetica,sans-serif;
            background-color: #949FB1;
            font-size: .85em;
            text-style: bold;
            color: #21334B;
            text-align: center;
            margin: 0.4em;
        }
        
        .columnStyle {
            font-family: ms sans serif,arial,verdana,helvetica,sans-serif;
            font-size: .9em;
            color: #21334B;
            text-align: left;
            margin: 0.4em;
        }
        
        /* USER ALERT */
        .userAlertTitle {
	        font-family: Verdana, ms sans serif, Tahoma, Arial, Helvetica, Sans-Serif;
	        color: #f90;
	        background-color: #888;
	        font-size: 15px;
	        font-weight: bold;
	        border-top: 1px solid #444;
	        border-bottom: 1px solid #444;
	        border-left: 1px solid #444;
	        border-right: 1px solid #444;
        }
        
        
        .userAlertBox {
	        background-color: #fff;
	        border-bottom: 1px solid #444;
	        border-left: 1px solid #444;
	        border-right: 1px solid #444;
        }

        .userAlert {
	        font-family: Verdana, ms sans serif, Tahoma, Arial, Helvetica, Sans-Serif;
	        color: #f30;
	        background-color: #ccc;
	        font-size: 12px;
	        text-align: center;
	        padding-top: 5px;
	        padding-bottom: 5px;
	        padding-left: 10px;
	        padding-right: 10px;
	        border: 1px solid #000;
        }


        .userAlertDT {
	        font-family: Verdana, ms sans serif, Tahoma, Arial, Helvetica, Sans-Serif;
	        color: #888;
	        font-size: 12px;
	        line-height: 16pt;
	        font-weight: bold;
	        background-color: #fff;
        }


        .userAlertDD {
	        font-family: Verdana, ms sans serif, Tahoma, Arial, Helvetica, Sans-Serif;
	        color: #888;
	        font-size: 10px;
	        line-height: 16pt;
	        background-color: #fff;
        }
        

        
    </style>
    <script language="javascript" type="text/javascript">
    function pageStart()
    {
      self.window.dialogWidth=900;
      self.window.dialogHeight=500;
    }
    </script>
</head>
<body onload="pageStart()">
    <form id="form1" runat="server">
    <div>
    <h1><asp:Label ID="TitleLabel" runat="server"></asp:Label></h1>
    <asp:GridView ID="StatusHistoryGridView" runat="server" CssClass="gridOffset" Width="625px" AutoGenerateColumns="False" PageSize="10" AllowPaging="true" DataKeyNames="ParticipantStatusHistoryId, CaseStatusId,CaseStatusReasonId" CellPadding="5" BorderColor="Gray" BorderStyle="Solid" GridLines="Vertical" EmptyDataText="No status history is available for this participant." AllowSorting="False">
            <HeaderStyle  CssClass="headerStyle" BackColor="#949FB1" BorderColor="Gray" VerticalAlign="Top" />
            <RowStyle CssClass="columnStyle" />
            <Columns>
                <asp:TemplateField HeaderText="Effective Date" SortExpression="DateCreated">
                  <ItemStyle HorizontalAlign="center" />
                   <ItemTemplate>
                         <%#Eval("EffectiveDate", "{0:MM/dd/yyyy}")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="EditEffectiveDateTextBox" runat="server" Text='<%#Eval("EffectiveDate", "{0:MM/dd/yyyy}")%>'></asp:TextBox>
                </EditItemTemplate>
                </asp:TemplateField>
                   <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>
                       <%#GetStatusDescription(Eval("CaseStatusId"))%>
                    </ItemTemplate>
                    <EditItemTemplate>
                    <asp:DropDownList ID="EditStatusDropDownList" DataTextField="Description" DataValueField="CaseStatusId" runat="server"></asp:DropDownList>
                    </EditItemTemplate>    
                </asp:TemplateField>
                   <asp:TemplateField HeaderText="Status Reason">
                    <ItemTemplate>
                       <%#GetStatusReasonDescription(Eval("CaseStatusReasonId"))%>
                    </ItemTemplate>
                    <EditItemTemplate>
                    <asp:DropDownList ID="EditStatusReasonDropDownList" DataTextField="Description" DataValueField="CaseStatusReasonId" runat="server"></asp:DropDownList>
                    </EditItemTemplate>    
                </asp:TemplateField>
                  <asp:TemplateField HeaderText="Est. Return Date">
                    <ItemTemplate>
                       <%#Eval("EstimatedReturnDate", "{0:MM/dd/yyyy}")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                    <asp:TextBox ID="EditEstimatedReturnDateTextBox" runat="server" Text='<%#Eval("EstimatedReturnDate", "{0:MM/dd/yyyy}")%>'></asp:TextBox>
                    </EditItemTemplate>    
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Comments">
                <ItemTemplate><%#Eval("Comments") %></ItemTemplate>
                <EditItemTemplate>
                  <asp:TextBox ID="EditCommentsTextBox" runat="server" Text='<%#Eval("Comments") %>'></asp:TextBox>
                </EditItemTemplate>
                </asp:TemplateField>
                
                <asp:CommandField ShowEditButton="true" EditText="Edit" UpdateText="Save" CancelText="Cancel" HeaderText="Action" />
            </Columns>
            <AlternatingRowStyle BackColor="#E8ECF4" />
            <EmptyDataRowStyle CssClass="label" HorizontalAlign="Center" />
        </asp:GridView>
    </div>
    <input type="button" class="button" onclick="self.close();" value="Close" />
    <br />
        <cc1:ValidationErrorSummary ID="ValidationErrorSummary1" runat="server" Visible="false" />
    
    </form>
</body>
</html>
